<script type="text/javascript" src="/static/js/DatePicker/WdatePicker.js"></script>
<script>
    $(function(){
        $('#balance').datagrid({
            columns:[[
                    {field:'selected', checkbox:true },
                    {field:'account_num',title:'交易账户',width:110},
                    {field:'item',title:'交易项目',width:60},
                    {field:'amount',title:'交易金额',width:60},
                    {field:'inmoney',title:'收入',width:60},
                    {field:'outmoney',title:'支出',width:60},
                    {field:'tradetime',title:'交易时间',width:60},
                    {field:'status',title:'交易状态',width:60},
                    {field:'tickettype',title:'彩票种类',width:60},
                    {field:'trademethod',title:'交易方法',width:60}
                ]],
                toolbar:[
         				{
         					id:'export_detail',
         					text:'导出',
         					iconCls:'icon-ok',
         					handler: export_record
         				}
         			],
                    onLoadError: function() {
                        $.jBox.tip('没有数据或根据搜索条件查不到相关数据', 'info');
                        $("div.datagrid-body").css("height",0).find("table > tbody").empty();
                        $("div.datagrid-view").css("height",'23px');
                     }
                 });
	    $('#balances').searchbox({
	        width:300,  
	        searcher:function(value,name){
	        	var starttime = $("#start_time").val()
	        	var endtime = $("#end_time").val()
	        	var result = $('#balance').datagrid('reload', {
	                        account: value,
	                        start:starttime,
	                        end:endtime
	                     });
	                 },
	        menu:'#balancemm',  
	        prompt:'请输入搜索条件'  
	});
});
    
    function export_record(){
 	   window.location.href = '/lottery/balance/detail/export';
    }
</script>

<div style="padding:20px;overflow:hidden;" class="ajust_height">
	<div style="float:left;margin-right:10px;">
		<label>开始时间：</label>
		<input type="text" id="start_time" size="22" value="" style="border:1px #55B7FF solid">
		<img onclick="WdatePicker({el:'start_time',dateFmt:'yyyy-MM-dd HH:mm:ss'})" src="/static/js/DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
	</div>
	<div style="float:left;margin-right:10px;"">
		<label>结束时间：</label>
		<input type="text" id="end_time" size="22" value="" style="border:1px #55B7FF solid">
		<img onclick="WdatePicker({el:'end_time',dateFmt:'yyyy-MM-dd HH:mm:ss'})" src="/static/js/DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
	</div>
	
     <div style="padding-bottom:20px;overflow:hidden;">
        <input id="balances"></input>
        <div id="balancemm" style="width:120px">
            <div name="account" iconCls="icon-ok">交易账户</div>
        </div>
    </div>
    
    <table id="balance" url="/lottery/balance/detail" striped="true"
        pagination="true" iconCls="icon-save" url="" fitColumns="true" singleSelect="false"
        rownumbers="true" pageSize="20"   pageList=" [20,30,40,50]">
    </table>
</div>
   